package com.zerous.simplerts;
import android.graphics.*;
import com.zerous.simplerts.math.*;

public class Sprite
{
	Bitmap src;
	
	public Sprite(Bitmap src)
	{
		this.src = src;
	}
	
	public void scale(float x, float y)
	{
		Matrix m = new Matrix();
		m.postScale(x, y);
		Bitmap scaled = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), m, true);
		src.recycle();
		src = scaled;
	}
	
	public int getWidth()
	{
		return src.getWidth();
	}
	
	public int getHeight()
	{
		return src.getHeight();
	}
	
	public void draw(Vec2 pos)
	{
		Zef.graphics.drawSprite(this, pos.x, pos.y);
	}
	
	public void dispose()
	{
		src.recycle();
	}
}
